<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/commons/basejs.jsp" %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>主页</title>
<link rel="stylesheet" type="text/css" href="${staticPath}/static/css/index.css">
<script type="text/javascript">
    var index_layout;
    var index_tabs;
    var index_tabsMenu;
    $(function() {
        index_layout = $('#index_layout').layout({
            fit : true
        });

        index_tabs = $('#index_tabs').tabs({
            fit : true,
            border : false
        });
    });

    function addTab(title,iconCls,url) {
        var iframe = '<iframe src="' + url + '" frameborder="0" style="border:0;width:100%;height:99.5%;"></iframe>';
        var t = $('#index_tabs');
        var opts = {
            title : title,
            closable : true,
            iconCls : iconCls,
            content : iframe,
            border : false,
            fit : true
        };
        if (t.tabs('exists', opts.title)) {
            t.tabs('select', opts.title);
        } else {
            t.tabs('add', opts);
        }
    }

    function logout(){
        $.messager.confirm('提示','确定要退出?',function(r){
            if (r){
                progressLoad();
                $.post('${base}/user/logout.do', function(result) {
                    if(result.code=='0'){
                        progressClose();
                        window.location.href='${base}/login.jsp';
                    }
                }, 'json');
            }
        });
    }

</script>
</head>
<body>
	<div id="index_layout">
		<div data-options="region:'north',border:false" style="overflow: hidden; height: 60px;">
			<!-- <div style="float: left;padding-top: 16px;padding-left: 20px;">
				<span style="font-size: 22px;font-weight: bold;">后台信息管理系统</span>
			</div> -->
			<div style="float: left;">
				<img alt="logo" src="${staticPath}/static/images/logo.png">
			</div>
			<div style="float: right;">
				<div style="padding-top: 10px;margin-right: 30px;">
					<span style="color: #CC33FF;">当前用户:</span><span style="color: #666633;">(<shiro:principal></shiro:principal>)</span>
				</div>
				<div style="padding-top: 10px;">
					<a href="javascript:void(0)" class="easyui-menubutton"
						data-options="menu:'#layout_north_kzmbMenu',iconCls:'icon-help'">控制面板</a>
					<div id="layout_north_kzmbMenu" style="width: 135px;">
						<div>个人信息</div>
						<div class="menu-sep"></div>
						<div>修改密码</div>
						<div class="menu-sep"></div>
						<div>切换皮肤</div>
					</div>
					<a href="javascript:void(0)" class="easyui-menubutton"
						data-options="menu:'#layout_north_zxMenu',iconCls:'icon-back'">注销</a>
					<div id="layout_north_zxMenu" style="width: 135px;">
						<div onclick="logout()">退出系统</div>
					</div>
				</div>
			</div>
		</div>
		<div data-options="region:'west',split:true" title="菜单"
			style="width: 200px; overflow: hidden; overflow-y: auto; padding: 0px">
			<div class="easyui-accordion" data-options="fit:true,border:false">
				<c:forEach items="${menuList}" var="item">
					<div id="menu" title="${item.name}" iconCls="${item.icon}">
						<ul>
							<c:forEach items="${item.sysResourceChild}" var="node">
								<li>
									<a onclick="addTab('${node.name}','${node.icon}','${path}${node.url}')">
									<div>
										<span class="icon ${node.icon}">&nbsp;</span>
										<span>${node.name}</span>
									</div>
									</a>
								</li>
							</c:forEach>
						</ul>
					</div>
				</c:forEach>
   			</div>
		</div>
		<div data-options="region:'center'" style="overflow: hidden;">
			<div id="index_tabs" style="overflow: hidden;">
				<div title="首页" iconCls="icon-world" data-options="border:false"
					style="overflow: hidden;"></div>
			</div>
		</div>
		<div data-options="region:'south',border:false"
			style="height: 30px; line-height: 30px; overflow: hidden; text-align: center; background-color: #eee">
			Copyright © 2015 power by <a href="http://www.aiitba.com/"
				target="_blank">版权所有</a>
		</div>
	</div>

	<!--[if lte IE 7]>
    <div id="ie6-warning"><p>您正在使用 低版本浏览器，在本页面可能会导致部分功能无法使用。建议您升级到 <a href="http://www.microsoft.com/china/windows/internet-explorer/" target="_blank">Internet Explorer 8</a> 或以下浏览器：
    <a href="http://www.mozillaonline.com/" target="_blank">Firefox</a> / <a href="http://www.google.com/chrome/?hl=zh-CN" target="_blank">Chrome</a> / <a href="http://www.apple.com.cn/safari/" target="_blank">Safari</a> / <a href="http://www.operachina.com/" target="_blank">Opera</a></p></div>
    <![endif]-->

    <style>
        /*ie6提示*/
        #ie6-warning{width:100%;position:absolute;top:0;left:0;background:#fae692;padding:5px 0;font-size:12px}
        #ie6-warning p{width:960px;margin:0 auto;}
    </style>
</body>
</html>